<?php
/**
 * 用户反馈结果
 *
 */
class UsercheckAction extends Action{
	
	/**
	 * @array 用户信息
	 */
	private $userInfo;
	
	/**
	 * @int 用户ID
	 */
	private $uid;
	
	function _initialize() {
		$this->userInfo = D('User')->getUserByName($_REQUEST['sellername']);
		if (empty($this->userInfo)) {
			exit();
		}
		$this->uid = $this->userInfo['usr_id'];
	}
	
	/**
	 * 得到用户待检测的IP 
	 */
	function lists() {
		echoJson(D('Checkresult')->alloc($this->uid));
	}
	
	/**
	 * 报告用户检测代理IP结果
	 */
	function report() {
		D('Checkresult')
			->where(array('usr_id'=>$this->uid,'agt_id'=>$_REQUEST['agt_id'],'crt_rank'=>0))
			->save(array('crt_rank'=>$_REQUEST['crt_rank'],'crt_lasttime'=>time()));
	}
}